package com.xjtu.project.aichat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;

@RestController
public class ChatController {
    @Autowired
    private ChatService chatService;
    //ai服务的地址为http://localhost:8080/chat
    @GetMapping(value = "/chat", produces = "text/html;charset=utf-8")
    public Flux<String> chat(@RequestParam("message") String message,@RequestParam("memoryId") String memoryId){
        return chatService.chat(message,memoryId);
    }
}
